//
//  UITextField+LeftView.m
//  MeiDa
//
//  Created by zfc on 2019/10/21.
//  Copyright © 2019年 depelec. All rights reserved.
//

#import "UITextField+LeftView.h"

@implementation UITextField (LeftView)


- (CGFloat) leftViewWidth {
    return self.leftViewWidth;
}

- (void) setLeftViewWidth:(CGFloat)leftViewWidth {
    if (leftViewWidth > 0) {
        UIView *view = [[UIView alloc] init];
        view.frame = CGRectMake(0, 0, leftViewWidth, 0);
        self.leftView = view;
        self.leftViewMode = UITextFieldViewModeAlways;
    } else {
        self.leftView = nil;
    }

}


@end
